<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); 

class Block_Post_Related extends Core_Block {

	protected $_items = null;
	
	public function getRelatedPostCollection() {
		if (!$this->_items) {
			$post = App::registry('post');
			if (!$post) throw new Exception('Post not defined.');
			$this->_items = $post->getRelatedPosts();
			$this->_items->getSelect()->limit(5)->order('update_time', 'desc');
		}
		return $this->_items;
	}
}